package com.example.function.integration.service.impl;

import com.alibaba.fastjson2.JSONObject;
import com.example.function.integration.mapper.AmanSysConfigMapper;
import com.example.function.integration.service.AmanSysConfigService;
import com.google.common.collect.Maps;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Description：
 * @Author： fengcheng
 * @Date： 2024/11/8 15:14
 */
@Service
public class AmanSysConfigServiceImpl implements AmanSysConfigService {

    @Resource
    private AmanSysConfigMapper amanSysConfigMapper;

    /**
     * 获取 AmanSysConfig 列表
     *
     * @return 包含 AmanSysConfig 的字符串列表
     */
    @Override
    public Map<String, List<String>> getAmanSysConfig() {
        Map<String, List<String>> map = Maps.newHashMap();
        List<String> amanSysConfig = amanSysConfigMapper.getAmanSysConfig();
        List<String> amanSysConfigByOprDataSource = amanSysConfigMapper.getAmanSysConfigByOprDataSource();
        List<String> amanSysConfigBySecDataSource = amanSysConfigMapper.getAmanSysConfigBySecDataSource();
        List<String> amanSysConfigBySysDataSource = amanSysConfigMapper.getAmanSysConfigBySysDataSource();
        map.put("dataSource", amanSysConfig);
        map.put("oprDataSource", amanSysConfigByOprDataSource);
        map.put("secDataSource", amanSysConfigBySecDataSource);
        map.put("sysDataSource", amanSysConfigBySysDataSource);
        System.out.println(JSONObject.toJSONString(map));
        return map;
    }
}
